package com.net.shop.car.manager.api.volley.response;

import com.net.shop.car.manager.api.model.VersionInfo;
import com.net.shop.car.manager.api.volley.Response;
import com.net.shop.car.manager.utils.Constants;
import com.net.shop.car.manager.utils.StringUtils;

public class VersionUpdateInfoResponse extends Response {

	/**
	 * 
	 */
	private VersionInfo versionInfo;

	public VersionUpdateInfoResponse() {
		super(Constants.UPDATE_VERSION);
	}

	@Override
	public String[] getContentTags() {
		// TODO Auto-generated method stub
		return new String[] { "ID", "VERSION_NAME", "VERSION_URL", "VERSION_ID" };
	}

	@Override
	public void parseContent(String content, int index) {
		versionInfo = new VersionInfo();
		switch (index) {
		case 0:
			versionInfo.setId(StringUtils.filterNull(content));
			break;
		case 1:
			versionInfo.setVersionName(StringUtils.filterNull(content));
			break;
		case 2:
			versionInfo.setVersionUrl(StringUtils.filterNull(content));
			break;
		case 3:
			versionInfo.setVersionId(StringUtils.filterNull(content));
			break;

		default:
			break;
		}
	}
	
	/**
	 * @return VersionInfo
	 */
	public VersionInfo getVersionInfo() {
		return versionInfo;
	}

}
